home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
TECHNICA
/
COMPUTER
/
H254.ZIP
/
IRITSM3S.ZIP
/
IRITFLTR
/
IRIT2RAY.DSK
(
.txt
)
< prev
next >
Wrap
Turbo C Context File
|
1991-11-12
|
11KB
|
296 lines
Turbo C Context File
MISC_LIB.LIB
CAGD_LIB.LIB
IRIT2RAY.C
MISC_LIB.LIB
CAGD_LIB.LIB
IRIT2RAY.C
MISC_LIB.LIB
CAGD_LIB.LIB
IRIT2RAY.C
MISC_LIB.LIB
CAGD_LIB.LIB
IRIT2RAY.C
MISC_LIB.LIB
CAGD_LIB.LIB
IRIT2RAY.C
MISC_LIB.LIB
CAGD_LIB.LIB
IRIT2RAY.C
MISC_LIB.LIB
CAGD_LIB.LIB
IRIT2RAY.C
MISC_LIB.LIB
CAGD_LIB.LIB
IRIT2RAY.C
MISC_LIB.LIB
CAGD_LIB.LIB
IRIT2RAY.C
MISC_LIB.LIB
CAGD_LIB.LIB
IRIT2RAY.C
MISC_LIB.LIB
CAGD_LIB.LIB
IRIT2RAY.C
..\MISC_LIB\IRITPRSR.C
\C\POLY3D\*.C
\C\MISC_LIB\*.H
\C\SM\*.H
..\MISC_LIB\IRITPRSR.H
*.BAK
..\SM\GEOMAT3D.C
..\SM\PROGRAM.H
\C\POLY3D-R\WIGGLE.DAT
..\POLY3D-R\*.C
..\POLY3D-R\*.DAT
*.GEO
*.RAY
*.GEOM
*.DAT
-P -M- -v saddle.mat saddle.bzr
-M -v saddle.mat saddle.bzr
arc90.bzr
\c\poly3d\cube.dat
\c\poly3d-r\wiggle.dat
-f 7 \c\poly3d-r\wiggle.dat
-f 15 \c\poly3d-r\wiggle.dat
-f 5 f:\twiggle.dat
-f 5 f:\t.dat
-f 5 \c\poly3d-r\solid2.dat
\c\poly3d-r\solid2.dat
t.dat
solid1c.dat
solid1.dat
void *.c
struct *.c
struct *.h
for *.c
void *.c
printf *.c
GraphicMode
ScreenCursorC
AllSrfs
MyFree
include
FineNess
PObject
PObject -> RGB
CrossP
%9.6lg
Trans
TransColorTable[PObject -> Color]
..\CAGD_LIB\*.C
..\CAGD_LIB\CAGDMESH.C
..\CAGD_LIB\CAGDCOER.C
..\CAGD_LIB\BZR_WRT.C
..\CAGD_LIB\BZR_READ.C
..\CAGD_LIB\BZR_GEN.C
..\CAGD_LIB\CAGD_LIB.LIB
CAGD_LIB.LIB
MISC_LIB.LIB
INTERACT.C
PCGRAPH.C
IRIT2RAY.C
StringToken
LastNormal
Normal
VNext
VNextNext
D:\C\MISC_LIB\IRITPRSR.H
D:\C\IRIT2RAY\IRIT2RAY.C
D:\C\POLY3D-R\COLORTBL.C
D:\C\POLY3D-R\EVALCOLR.C
D:\C\SM\GEOMAT3D.C
D:\C\SM\PROGRAM.H
F:\T.DAT
F:\T.DAT
D:\C\IRIT2RAY\IRIT2RAY.GEO
D:\C\IRIT2RAY\IRIT2RAY.RAY
D:\C\IRIT2RAY\IRIT2RAY.RAY
D:\C\IRIT2RAY\IRIT2RAY.GEO
D:\C\IRIT2RAY\IRIT2RAY.RAY
D:\C\IRIT2RAY\IRIT2RAY.C
D:\C\IRITFLTR\SOLID1.DAT
D:\C\IRITFLTR\IRIT2RAY.C
BGIDriverPath
void GGInstallBGI(char *BGIDriverPath, char *NameMode)
/*****************************************************************************
* Routine to draw all the objects in object list Objects. *
*****************************************************************************/
void DrawAllObjects(IPObjectStruct *Objects)
while (Objects) {
DrawOneObject(Objects);
Objects = Objects -> Pnext;
}
/*****************************************************************************
* Routine to draw one object Object. *
*****************************************************************************/
static void DrawOneObject(IPObjectStruct *PObject)
IPPolygonStruct *PList = PObject -> PPolygon;
GGMySetColor(PObject -> Color);
while (PList) {
DrawOnePolygon(PList);
PList = PList -> Pnext;
}
/*****************************************************************************
* Routine to draw one polygon, using global Matrix transform Mat. *
* Note this is the routine that makes the real drawing... *
*****************************************************************************/
static void DrawOnePolygon(IPPolygonStruct *PPolygon)
int i, j, DrawNextEdge, NumOfVertices;
RealType MappedNormal[3], PolyNormal[3];
IPVertexStruct
*VList = PPolygon -> PVertex,
*VHead = VList;
if (VList == NULL) return;
TestQuitView();
switch (PPolygon -> Type) {
case IP_POINTLIST:
MoveToPtr(VList -> Coord);
DrawToPtr(VList -> Coord);
VList = VList -> Pnext;
for (i = 0;
i < GlblNumEdges && VList != NULL && VList != VHead;
i++) {
MoveToPtr(VList -> Coord);
DrawToPtr(VList -> Coord);
VList = VList -> Pnext;
}
break;
case IP_POLYLINE:
MoveToPtr(VList -> Coord);
DrawNextEdge = !IP_IS_VRTX_INTERNAL(VList);
VList = VList -> Pnext;
for (i = 1;
i < GlblNumEdges && VList != NULL && VList != VHead;
i++) {
if (DrawNextEdge || GlblInternal)
DrawToPtr(VList -> Coord);
else
MoveToPtr(VList -> Coord);
DrawNextEdge = !IP_IS_VRTX_INTERNAL(VList);
VList = VList -> Pnext;
}
break;
case IP_POLYGON:
#ifdef __GL__
if (GlblDrawSolid) {
GGMyDrawPolygonSolid(PPolygon);
break;
}
#endif
if (GlblDrawPNormal && IP_HAS_POLY_PLANE(PPolygon)) {
/* Sum all points to be averaged for normal position. */
for (i = 0; i < 3; i++) PolyNormal[i] = VList -> Coord[i];
NumOfVertices = 1;
}
MoveToPtr(VList -> Coord);
DrawNextEdge = !IP_IS_VRTX_INTERNAL(VList);
VList = VList -> Pnext;
for (i = 1;
i < GlblNumEdges && VList != NULL && VList != VHead;
i++) {
if (DrawNextEdge || GlblInternal)
DrawToPtr(VList -> Coord);
else
MoveToPtr(VList -> Coord);
if (GlblDrawVNormal && IP_HAS_VRTX_NORMAL(VList)) {
for (j = 0; j < 3; j++) MappedNormal[j] =
VList -> Coord[j] + VList -> Normal[j] * GlblNormalLen;
j = GlblClosedObject;
GlblClosedObject = FALSE;
DrawToPtr(MappedNormal);
MoveToPtr(VList -> Coord);
GlblClosedObject = j;
if (GlblDrawPNormal && IP_HAS_POLY_PLANE(PPolygon)) {
for (j = 0; j < 3; j++) PolyNormal[j] += VList -> Coord[j];
NumOfVertices++;
DrawNextEdge = !IP_IS_VRTX_INTERNAL(VList);
VList = VList -> Pnext;
}
if (GlblNumEdges > i) {
/* Close polygon by drawing a line to first vertex. */
if (DrawNextEdge || GlblInternal)
DrawToPtr(VHead -> Coord);
else
MoveToPtr(VHead -> Coord);
if (GlblDrawVNormal && IP_HAS_VRTX_NORMAL(VList)) {
for (j = 0; j < 3; j++) MappedNormal[j] =
VList -> Coord[j] + VList -> Normal[j] * GlblNormalLen;
j = GlblClosedObject;
GlblClosedObject = FALSE;
DrawToPtr(MappedNormal);
MoveToPtr(VList -> Coord);
GlblClosedObject = j;
}
if (GlblDrawPNormal && IP_HAS_POLY_PLANE(PPolygon)) {
for (i = 0; i < 3; i++) PolyNormal[i] /= NumOfVertices;
MoveToPtr(PolyNormal);
for (i = 0; i < 3; i++)
PolyNormal[i] += PPolygon -> Plane[i] * GlblNormalLen;
i = GlblClosedObject;
GlblClosedObject = FALSE;
DrawToPtr(PolyNormal);
GlblClosedObject = i;
}
break;
}
MultVecby4by4(LastCoord, Coord, CrntViewMat); /* Set last point coord. */
#define MAX_NUM_ATTRS 10
/*****************************************************************************
* Attributes - geometry types (Surfaces/Curves/Polygons/Polylines) have this *
* structure for keeping general attributes like colors etc. *
*****************************************************************************/
typedef struct AttributeStruct {
ByteType Color; /* Color of geometry. */
ByteType NumStrAttribs;
char *StrAttrName[MAX_NUM_ATTRS + 1]; /* Generic string attrs. */
char *StrAttrData[MAX_NUM_ATTRS + 1];
} AttributeStruct;
MAX_NUM_ATTRS
if (IritPrsrWasPrspMat)
MultTwo4by4(GlblViewMat, IritPrsrViewMat, IritPrsrPrspMat);
else
GEN_COPY(GlblViewMat, IritPrsrViewMat, sizeof(MatrixType));
#define GEN_COPY(Dest, Src, Size) memcpy(Dest, Src, Size)
static int TransColorTable[][4] = {
{ /* BLACK */ 0, 0, 0, 0 },
{ /* BLUE */ 1, 0, 0, 255 },
{ /* GREEN */ 2, 0, 255, 0 },
{ /* CYAN */ 3, 0, 255, 255 },
{ /* RED */ 4, 255, 0, 0 },
{ /* MAGENTA */ 5, 255, 0, 255 },
{ /* BROWN */ 6, 50, 0, 0 },
{ /* LIGHTGRAY */ 7, 127, 127, 127 },
{ /* DARKGRAY */ 8, 63, 63, 63 },
{ /* LIGHTBLUE */ 9, 0, 0, 255 },
{ /* LIGHTGREEN */ 10, 0, 255, 0 },
{ /* LIGHTCYAN */ 11, 0, 255, 255 },
{ /* LIGHTRED */ 12, 255, 0, 0 },
{ /* LIGHTMAGENTA */ 13, 255, 0, 255 },
{ /* YELLOW */ 14, 255, 255, 0 },
{ /* WHITE */ 15, 255, 255, 255 },
{ /* BROWN */ 20, 50, 0, 0 },
{ /* DARKGRAY */ 56, 63, 63, 63 },
{ /* LIGHTBLUE */ 57, 0, 0, 255 },
{ /* LIGHTGREEN */ 58, 0, 255, 0 },
{ /* LIGHTCYAN */ 59, 0, 255, 255 },
{ /* LIGHTRED */ 60, 255, 0, 0 },
{ /* LIGHTMAGENTA */ 61, 255, 0, 255 },
{ /* YELLOW */ 62, 255, 255, 0 },
{ /* WHITE */ 63, 255, 255, 255 },
{ -1, 0, 0, 0 }
/*****************************************************************************
* Routine to calculate the cross product of two vectors: *
* Note Vres might be the same as V1 or V2 ! *
*****************************************************************************/
void VecCrossProd(VectorType Vres, VectorType V1, VectorType V2)
VectorType Vtemp;
Vtemp[0] = V1[1] * V2[2] - V2[1] * V1[2];
Vtemp[1] = V1[2] * V2[0] - V2[2] * V1[0];
Vtemp[2] = V1[0] * V2[1] - V2[0] * V1[1];
VecCopy(Vres, Vtemp);
#define DOT_PROD(Pt1, Pt2) (Pt1[0] * Pt2[0] + \
Pt1[1] * Pt2[1] + \
Pt1[2] * Pt2[2])